<template>
  <div class="container" ref="loginContainer">
    <div class="forms-container">
      <div class="signin-signup">
        <form action="#" class="sign-in-form" v-if="actionType ==='login'">
          <div style="display: flex;align-items: center;">
            <a style="width: 70px" href="https://www.chatpet.top">
              <img src="../assets/img/chatpet.png" style="width: 50px;height: 50px"/>
            </a>
            <h2 class="title" style="margin-bottom:0px">{{t('message.login_main_title')}}</h2>
          </div>
          <div class="input-field">
            <i class="fas fa-user"></i>
            <input type="text" :placeholder="t('message.login_main_name')"  v-model="username" autocomplete="off" autofocus
                   @keyup="handleKeyup"/>
          </div>
          <div class="input-field">
            <i class="fas fa-lock"></i>
            <input :type="loginPasswordType" :placeholder="t('message.login_main_password')" v-model="password" autocomplete="off"
                   @keyup="handleKeyup" style="width: 270px"/>
            <i class="fas fa-eye-slash" v-if="loginPasswordType==='password'" @click="loginPasswordType='text'"></i>
            <i class="fas fa-eye" v-else @click="loginPasswordType='password'"></i>
          </div>
          <div style="width: 100%;max-width:380px;display: flex" v-if="captchaEnabled">
            <div class="input-field" style="max-width: 200px;width: 50%;">
              <i class="fas fa-clipboard-check"></i>
              <input type="text" :placeholder="t('message.login_main_code')" style="width: 100px" v-model="code" autocomplete="off"/>
            </div>
            <div class="login-code" >
              <img :src="codeUrl" @click="getCode" class="login-code-img"/>
            </div>
          </div>
          <div style="width: 100%;max-width:360px;display: flex;align-items: center">
            <div style="width: 50%;display: flex;justify-content: left;">
              <el-checkbox v-model="secretFreeLoginFlag">
                <div  class="clause">{{ t('message.login_main_secret_free_login') }}</div>
              </el-checkbox>
            </div>
            <div style="width: 50%;display: flex;justify-content: right;">
              <div class="forget-password" @click="actionType = 'forget'">{{ t('message.login_main_forget_title') }}</div>
            </div>
          </div>
          <input type="submit" :value="t('message.login_main_login')" class="btn solid" @click="login" style="margin-top: 10px"/>
          <div class="divider">
            <span class="line"></span>
            <span class="divider-text">{{t('message.login_main_or')}}</span>
            <span class="line"></span>
          </div>
          <div class="social-media">
            <div class="social-icon">
              <i class="fas fa-envelope"></i>
            </div>
            <div class="social-icon" @click="wechatLogin">
              <i class="fab fa-weixin"></i>
            </div>
            <div class="social-icon">
              <i class="fab fa-weibo"></i>
            </div>
            <div class="social-icon">
              <i class="fab fa-github-alt"></i>
            </div>
          </div>
        </form>
        <form action="#" class="sign-in-form" v-if="actionType ==='forget'">
          <h2 class="title">{{t('message.login_main_forget_title')}}</h2>
          <div class="input-field">
            <i class="fas fa-envelope"></i>
            <input type="email" :placeholder="t('message.login_main_email')" />
          </div>
          <div style="width: 100%;max-width:380px;display: flex" v-if="captchaEnabled">
            <div class="input-field" style="max-width: 200px;width: 50%;">
              <i class="fas fa-clipboard-check"></i>
              <input type="text" :placeholder="t('message.login_main_code')" style="width: 100px" v-model="code" autocomplete="off"/>
            </div>
            <div class="login-code" style="justify-content: right">
              <el-button type="primary" style="height: 95%;width: 90%;border-radius: 50px">{{ t('message.login_main_get_code') }}</el-button>
            </div>
          </div>
          <div class="input-field">
            <i class="fas fa-lock"></i>
            <input :type="registerPasswordType" :placeholder="t('message.login_main_new_password')" />
            <i class="fas fa-eye-slash" v-if="registerPasswordType ==='password'" @click="registerPasswordType='text'"></i>
            <i class="fas fa-eye" v-else @click="registerPasswordType='password'"></i>
          </div>
          <div style="width: 100%;max-width:380px;display: flex;justify-content: right">
            <div class="forget-password" @click="actionType = 'login'">{{ t('message.login_main_back_login') }}</div>
          </div>
          <input type="submit" :value="t('message.login_main_get_password')" class="btn solid" @click="login" style="margin-top: 10px"/>
        </form>
        <form action="#" class="sign-up-form">
          <h2 class="title">{{ t('message.login_main_register') }}<span style="color: #C689FF">Chat</span><span style="color: #ADDFFF">Pet</span></h2>
          <div class="input-field">
            <i class="fas fa-user"></i>
            <input type="text" :placeholder="t('message.login_main_name')" />
          </div>
          <div class="input-field">
            <i class="fas fa-envelope"></i>
            <input type="email" :placeholder="t('message.login_main_email')" />
          </div>
          <div style="width: 100%;max-width:380px;display: flex" v-if="captchaEnabled">
            <div class="input-field" style="max-width: 200px;width: 50%;">
              <i class="fas fa-clipboard-check"></i>
              <input type="text" :placeholder="t('message.login_main_code')" style="width: 100px" v-model="code" autocomplete="off"/>
            </div>
            <div class="login-code" style="justify-content: right">
              <el-button type="primary" style="height: 95%;width: 90%;border-radius: 50px">{{ t('message.login_main_get_code') }}</el-button>
            </div>
          </div>
          <div class="input-field">
            <i class="fas fa-lock"></i>
            <input :type="registerPasswordType" :placeholder="t('message.login_main_new_password')" />
            <i class="fas fa-eye-slash" v-if="registerPasswordType ==='password'" @click="registerPasswordType='text'"></i>
            <i class="fas fa-eye" v-else @click="registerPasswordType='password'"></i>
          </div>
          <div class="input-field">
            <i class="fas fa-lock"></i>
            <input :type="confirmPasswordType" :placeholder="t('message.login_main_new_confirm')" />
            <i class="fas fa-eye-slash" v-if="confirmPasswordType ==='password'" @click="confirmPasswordType ='text'"></i>
            <i class="fas fa-eye" v-else @click="confirmPasswordType='password'"></i>
          </div>
          <div style="width: 100%;max-width:360px;display: flex;justify-content: left">
            <el-checkbox v-model="agreeClauseFlag">
               <div @click.stop="agreeClause" class="clause">{{ t('message.login_main_clause') }}</div>
            </el-checkbox>
          </div>
          <input type="submit" class="btn" :value="t('message.login_main_register_now')" />
        </form>
      </div>
    </div>

    <div class="panels-container">
      <div class="panel left-panel">
        <div class="content">
          <h3>加入我们</h3>
          <p>
            加入我们，成为本站的一份子。
          </p>
          <button class="btn transparent" id="sign-up-btn" @click="goToRegister">
            去注册
          </button>
        </div>
        <img src="@/assets/img/log.svg" class="image" alt="" v-if="actionType==='login'"/>
      </div>
      <div class="panel right-panel">
        <div class="content">
          <h3>已有帐号？</h3>
          <p>
            立即登录已有帐号，享受独家权益。
          </p>
          <button class="btn transparent" id="sign-in-btn" @click="goToLogin">
            去登录
          </button>
        </div>
        <img src="@/assets/img/register.svg" class="image" alt="" />
      </div>
    </div>
  </div>


</template>
<script setup>
import {ref, getCurrentInstance} from "vue";
import * as loginModel from "@/assets/js/loginModel.js";
import {Checked, Lock, UserFilled} from "@element-plus/icons-vue";
import {httpGet, httpPost} from "@/utils/http";
import {ElMessage} from "element-plus";
import {useRouter} from "vue-router";
import FooterBar from "@/components/FooterBar.vue";
import {isMobile} from "@/utils/libs";
import {checkSession} from "@/action/session";
import {setUserToken} from "@/store/session";
import {prevRoute} from "@/router";
import ResetPass from "@/components/ResetPass.vue";
import { useI18n } from 'vue-i18n';//从i18n中引入
const { t } = useI18n();

const router = useRouter();
const title = ref('ChatPet 用户登录');
const username = ref(process.env.VUE_APP_USER);
const password = ref(process.env.VUE_APP_PASS);
const showResetPass = ref(false)
const codeUrl = ref('');
const uuid = ref('');
const code = ref('');
const loginPasswordType= ref('password');
const registerPasswordType= ref('password');
const confirmPasswordType= ref('password');
const actionType= ref('login');
const secretFreeLoginFlag= ref(false);
const agreeClauseFlag= ref(false);
// 验证码开关
const captchaEnabled = ref(true);

const agreeClause =function () {
  agreeClauseFlag.value=true;
  window.open('/clause');
}

/**
 * 获取验证码
 */
const getCode = async () => {
  httpGet('/api/captcha/code').then((res) => {
    captchaEnabled.value = res.data.captcha_enabled === undefined ? true : res.data.captcha_enabled;
    if (captchaEnabled.value) {
      codeUrl.value = 'data:image/gif;base64,' + res.data.img;
      uuid.value = res.data.uuid;
    }
  }).catch((e) => {
    ElMessage.error('获取验证码失败，' + e.message)
  })
};
getCode()
const wechatUrl = ref('');
const ticket = ref('');
const timer = ref(null)
const wechatImgLoadIng = ref(true);
const showWechatLogin = ref(false)
const wechatLogin = async () => {
  showWechatLogin.value = !showWechatLogin.value
  if (showWechatLogin.value){
    await refreshWechatCode('login')
  }
};
const refreshWechatCode = async (action) => {
  wechatImgLoadIng.value = true
  httpGet('/api/user/getLoginQrCode').then((res) => {
    wechatUrl.value = res.data.code_url;
    ticket.value = res.data.ticket;
    wechatImgLoadIng.value = false
    timer.value = setInterval(() => {
      loginBySnece(action)
    }, 1000)

  }).catch((e) => {
    wechatImgLoadIng.value = false
    ElMessage.error('获取验证码失败，' + e.message)
  })
};
checkSession().then(() => {
  if (isMobile()) {
    router.push('/mobile')
  } else {
    router.push('/chat')
  }
}).catch(() => {
})
async function loginBySnece(action) {
  if (action === 'login' && !showWechatLogin.value) {
    clearInterval(timer.value)
    return
  }
  httpGet('/api/user/wechatOpenIdLogin?ticket=' + ticket.value).then((res) => {
    if (res.data && res.data.token) {
      clearInterval(timer.value)
      setUserToken(res.data.token)
      ElMessage.success("登录成功！")
      if (isMobile()) {
        router.push('/mobile')
      } else {
        router.push('/chat')
      }
    }
  }).catch((e) => {
    ElMessage.error('二维码已过期，请重新扫码!')
    clearInterval(timer.value)
  })
}

const handleKeyup = (e) => {
  if (e.key === 'Enter') {
    login();
  }
};

const login = function () {
  if (username.value.trim() === '') {
    return ElMessage.error("请输入用户民")
  }
  if (password.value.trim() === '') {
    return ElMessage.error('请输入密码');
  }
  if (code.value.trim() === '') {
    return ElMessage.error('请输入验证码');
  }
  httpPost('/api/user/login', {username: username.value.trim(), password: password.value.trim(),code:code.value.trim(),uuid:uuid.value.trim()}).then((res) => {
    setUserToken(res.data.token)
    if (prevRoute.path === '' || prevRoute.path === '/register') {
      if (isMobile()) {
        router.push('/mobile')
      } else {
        router.push('/chat')
      }
    } else {
      router.push(prevRoute.path)
    }

  }).catch((e) => {
    ElMessage.error('登录失败，' + e.message)
  })
  getCode()
}

const pageInstance = getCurrentInstance();

const goToRegister= function (){
  pageInstance.refs.loginContainer.classList.add("sign-up-mode");
}

const goToLogin= function (){
  pageInstance.refs.loginContainer.classList.remove("sign-up-mode");
}

</script>
<style  lang="stylus">
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400;500;600;700;800&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body,
input {
  font-family: "Poppins", sans-serif;
}

.container {
  position: relative;
  width: 100%;
  background-color: #fff;
  min-height: 100vh;
  overflow: hidden;
}

.forms-container {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.signin-signup {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  left: 75%;
  width: 50%;
  transition: 1s 0.7s ease-in-out;
  display: grid;
  grid-template-columns: 1fr;
  z-index: 5;
}

form {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0rem 5rem;
  transition: all 0.2s 0.7s;
  overflow: hidden;
  grid-column: 1 / 2;
  grid-row: 1 / 2;
}

form.sign-up-form {
  opacity: 0;
  z-index: 1;
}

form.sign-in-form {
  z-index: 2;
}

.title {
  font-size: 2.2rem;
  letter-spacing: 2px;
  color: #444;
  margin-bottom: 10px;
}

.code_input-field {
  max-width: 180px;
  width: 50%;
  background-color: #f0f0f0;
  margin: 10px 0;
  height: 55px;
  border: #f0f0f0 solid 2px;
  border-radius: 55px;
  display: flex;
  grid-template-columns: 15% 85%;
  padding: 0 0.4rem;
  position: relative;
}

.input-field {
  max-width: 380px;
  width: 100%;
  background-color: #f0f0f0;
  margin: 10px 0;
  height: 55px;
  border: #f0f0f0 solid 2px;
  border-radius: 55px;
  display: flex;
  padding: 0 0.4rem;
  position: relative;
}

.input-field:hover{
  border: #409eff solid 2px;
}

.input-field:focus-within{
  border: #409eff solid 2px;
}


.input-field i {
  text-align: center;
  line-height: 55px;
  width: 50px !important;
  color: #acacac;
  transition: 0.5s;
  font-size: 1.1rem;
}

.input-field input {
  width: 300px;
  background: none;
  outline: none;
  border: none;
  line-height: 1;
  font-weight: 600;
  font-size: 1.1rem;
  color: #333;
}

.input-field input::placeholder {
  color: #aaa;
  font-weight: 500;
}

.forget-password{
  font-size: 15px;
  font-weight: bold;
  margin-right: 10px;
  color: #a2acb9;
}

.forget-password:hover{
  color: #409eff;
}

.social-text {
  padding: 0.7rem 0;
  font-size: 1rem;
}

.social-media {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.social-icon {
  height: 46px;
  width: 46px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 0.45rem;
  color: #333;
  border-radius: 50%;
  border: 1px solid #333;
  text-decoration: none;
  font-size: 1.1rem;
  transition: 0.3s;
}

.social-icon:hover {
  color: #4481eb;
  border-color: #4481eb;
}

.btn {
  max-width: 380px;
  width 100%;
  background-color: #5995fd;
  border: none;
  outline: none;
  height: 49px;
  border-radius: 49px;
  color: #fff;
  text-transform: uppercase;
  font-weight: 600;
  margin: 10px 0;
  cursor: pointer;
  transition: 0.5s;
}

.btn:hover {
  background-color: #4d84e2;
}
.panels-container {
  position: absolute;
  height: 100%;
  width: 100%;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.container:before {
  content: "";
  position: absolute;
  height: 2000px;
  width: 2000px;
  top: -10%;
  right: 48%;
  transform: translateY(-50%);
  background-image: linear-gradient(to right,#3076F6,#AE2DF2);
  transition: 1.8s ease-in-out;
  border-radius: 50%;
  z-index: 6;
}

.image {
  width: 100%;
  transition: transform 1.1s ease-in-out;
  transition-delay: 0.4s;
}

.panel {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-around;
  text-align: center;
  z-index: 6;
}

.left-panel {
  pointer-events: all;
  padding: 3rem 17% 2rem 12%;
}

.right-panel {
  pointer-events: none;
  padding: 3rem 12% 2rem 17%;
}

.panel .content {
  color: #fff;
  transition: transform 0.9s ease-in-out;
  transition-delay: 0.6s;
}

.panel h3 {
  font-weight: 600;
  line-height: 1;
  font-size: 1.5rem;
}

.panel p {
  font-size: 0.95rem;
  padding: 0.7rem 0;
}

.btn.transparent {
  margin: 0;
  background: none;
  border: 2px solid #fff;
  width: 130px;
  height: 41px;
  font-weight: 600;
  font-size: 0.8rem;
}

.right-panel .image,
.right-panel .content {
  transform: translateX(800px);
}

.el-checkbox{
  color: #a2acb9;
}

  .clause{
    font-weight: bold;
    font-size: 15px;
  }

  .clause:hover{
    color #3076F6;
  }

/* ANIMATION */

.container.sign-up-mode:before {
  transform: translate(100%, -50%);
  right: 52%;
}

.container.sign-up-mode .left-panel .image,
.container.sign-up-mode .left-panel .content {
  transform: translateX(-800px);
}

.container.sign-up-mode .signin-signup {
  left: 25%;
}

.container.sign-up-mode form.sign-up-form {
  opacity: 1;
  z-index: 2;
}

.container.sign-up-mode form.sign-in-form {
  opacity: 0;
  z-index: 1;
}

.container.sign-up-mode .right-panel .image,
.container.sign-up-mode .right-panel .content {
  transform: translateX(0%);
}

.container.sign-up-mode .left-panel {
  pointer-events: none;
}

.container.sign-up-mode .right-panel {
  pointer-events: all;
}

@media (max-width: 870px) {
  .container {
    min-height: 800px;
    height: 100vh;
  }
  .signin-signup {
    width: 100%;
    top: 95%;
    transform: translate(-50%, -100%);
    transition: 1s 0.8s ease-in-out;
  }

  .signin-signup,
  .container.sign-up-mode .signin-signup {
    left: 50%;
  }

  .panels-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 2fr 1fr;
  }

  .panel {
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    padding: 2.5rem 8%;
    grid-column: 1 / 2;
  }

  .right-panel {
    grid-row: 3 / 4;
  }

  .left-panel {
    grid-row: 1 / 2;
  }

  .image {
    width: 200px;
    transition: transform 0.9s ease-in-out;
    transition-delay: 0.6s;
  }

  .panel .content {
    padding-right: 15%;
    transition: transform 0.9s ease-in-out;
    transition-delay: 0.8s;
  }

  .panel h3 {
    font-size: 1.2rem;
  }

  .panel p {
    font-size: 0.7rem;
    padding: 0.5rem 0;
  }

  .btn.transparent {
    width: 110px;
    height: 35px;
    font-size: 0.7rem;
  }

  .container:before {
    width: 1500px;
    height: 1500px;
    transform: translateX(-50%);
    left: 30%;
    bottom: 68%;
    right: initial;
    top: initial;
    transition: 2s ease-in-out;
  }

  .container.sign-up-mode:before {
    transform: translate(-50%, 100%);
    bottom: 32%;
    right: initial;
  }

  .container.sign-up-mode .left-panel .image,
  .container.sign-up-mode .left-panel .content {
    transform: translateY(-300px);
  }

  .container.sign-up-mode .right-panel .image,
  .container.sign-up-mode .right-panel .content {
    transform: translateY(0px);
  }

  .right-panel .image,
  .right-panel .content {
    transform: translateY(300px);
  }

  .container.sign-up-mode .signin-signup {
    top: 5%;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 570px) {
  form {
    padding: 0 1.5rem;
  }

  .image {
    display: none;
  }
  .panel .content {
    padding: 0.5rem 1rem;
  }
  .container {
    padding: 1.5rem;
  }

  .container:before {
    bottom: 72%;
    left: 50%;
  }

  .container.sign-up-mode:before {
    bottom: 28%;
    left: 50%;
  }
}



:root {
  /* COLORS */
  --white: #e9e9e9;
  --gray: #333;
  --blue: #0367a6;
  --lightblue: #008997;

  .login-start{
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #9932CC;
    background-image: radial-gradient(closest-side, rgba(15, 3, 250, 1), rgba(15, 3, 250, 0)),
        radial-gradient(closest-side, rgba(42, 8, 66, 1), rgba(42, 8, 66, 0)),
        radial-gradient(closest-side, rgba(15, 3, 250, 1), rgba(15, 3, 250, 0)),
        radial-gradient(closest-side, rgba(42, 8, 66, 1), rgba(42, 8, 66, 0)),
        radial-gradient(closest-side, rgba(104, 15, 247, 1), rgba(104, 15, 247, 0));
    background-size: 130vmax 130vmax, 80vmax 80vmax, 90vmax 90vmax, 110vmax 110vmax, 90vmax 90vmax;
    background-position: -80vmax -80vmax,60vmax -30vmax, 10vmax 10vmax,-30vmax -10vmax, 50vmax 50vmax;
    background-repeat: no-repeat;
    animation: 4s movement linear infinite;
    align-items: center;
    background-attachment: fixed;
    display: grid;
    place-items: center;
    //background: url("http://bpic.588ku.com/back_origin_min_pic/19/04/12/6b7ccd1ce2dcbf03382c8d926e82ee04.jpg") ;
    //background-color: var(--white);
    /* 决定背景图像的位置是在视口内固定，或者随着包含它的区块滚动。 */
    /* https://developer.mozilla.org/zh-CN/docs/Web/CSS/background-attachment */
    //background-position: center;
    //background-repeat: no-repeat;
    //background-size: cover;
    //height: 100vh;
  }

  .divider{
    width: 100%;
    max-width:380px;
    margin: 20px 0;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .line{
      display: inline-block;
      max-width: 35%;
      width: 35%;
      flex: 1;
      height: 1px;
      background-color: rgb(162,172,185);
    }
    .divider-text{
      vertical-align: middle;
      margin: 0 20px;
      display: inline-block;
      width: 50px;
      color: rgb(162,172,185);
      white-space: normal;
    }
  }

  --button-radius: 0.7rem;

  /* RADII */
  /* SIZES */
  --max-width: 758px;
  --max-height: 420px;

  font-size: 16px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
      Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}



@keyframes movement {
  0%, 100% {
    background-size: 130vmax 130vmax, 80vmax 80vmax, 90vmax 90vmax, 110vmax 110vmax, 90vmax 90vmax;
    background-position: -80vmax -80vmax,60vmax -30vmax, 10vmax 10vmax,-30vmax -10vmax, 50vmax 50vmax;
  }
  25% {
    background-size: 100vmax 100vmax, 90vmax 90vmax, 100vmax 100vmax, 90vmax 90vmax, 60vmax 60vmax;
    background-position: -60vmax -60vmax,50vmax -40vmax,0vmax -20vmax,-40vmax -20vmax, 40vmax 60vmax;
  }
  50% {
    background-size: 80vmax 80vmax, 110vmax 110vmax, 80vmax 80vmax, 60vmax 60vmax, 80vmax 80vmax;
    background-position: -50vmax -70vmax,40vmax -40vmax,0vmax -20vmax,-40vmax -20vmax, 40vmax 60vmax;
  }
  75% {
    background-size: 90vmax 90vmax, 90vmax 90vmax, 100vmax 100vmax, 60vmax 60vmax, 80vmax 80vmax;
    background-position: -50vmax -70vmax,40vmax -30vmax, 10vmax 0vmax, 20vmax 10vmax, 30vmax 70vmax;
  }
}

.form__title {
  font-weight: 300;
  margin: 0;
  margin-bottom: 1.25rem;
}



.login-container {
  background-color: var(--white);
  border-radius: var(--button-radius);
  box-shadow: 0 0.9rem 1.7rem rgba(0, 0, 0, 0.25),
      0 0.7rem 0.7rem rgba(0, 0, 0, 0.22);
  height: var(--max-height);
  max-width: var(--max-width);
  overflow: hidden;
  position: relative;
  width: 100%;
}

.login-container__form {
  height: 100%;
  position: absolute;
  top: 0;
  transition: all 0.6s ease-in-out;
}

.login-container--signin {
  left: 0;
  width: 50%;
  z-index: 2;
}

.login-container.right-panel-active .login-container--signin {
  transform: translateX(100%);
}

.login-container--signup {
  left: 0;
  opacity: 0;
  width: 50%;
  z-index: 1;
}

.login-container.right-panel-active .login-container--signup {
  animation: show 0.6s;
  opacity: 1;
  transform: translateX(100%);
  z-index: 5;
}

.login-container__overlay {
  height: 100%;
  left: 50%;
  overflow: hidden;
  position: absolute;
  top: 0;
  transition: transform 0.6s ease-in-out;
  width: 50%;
  z-index: 100;
}

.login-container.right-panel-active .login-container__overlay {
  transform: translateX(-100%);
}

.overlay {
  background-color: var(--lightblue);
  background: url("https://i04piccdn.sogoucdn.com/9a716e4a4e3687e2");
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  height: 100%;
  left: -100%;
  position: relative;
  transform: translateX(0);
  transition: transform 0.6s ease-in-out;
  width: 200%;
}

.login-container.right-panel-active .overlay {
  transform: translateX(50%);
}





.login-container.right-panel-active .overlay--left {
  transform: translateX(0);
}


.login-container.right-panel-active .overlay--right {
  transform: translateX(20%);
}

.btns {
  background-color: var(--blue);
  background-image: linear-gradient(90deg, var(--blue) 0%, var(--lightblue) 74%);
  border-radius: 20px;
  border: 1px solid var(--blue);
  color: var(--white);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.1rem;
  padding: 0.9rem 4rem;
  text-transform: uppercase;
  transition: transform 80ms ease-in;
  margin-bottom: 1rem;
}

.form>.btn {
  margin-top: 1.5rem;
}

.btn:active {
  transform: scale(0.95);
}

.btn:focus {
  outline: none;
}

.form {
  background-color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0 3rem;
  height: 100%;
  text-align: center;
}

.input {
  background-color: #fff;
  border: none;
  padding: 0.9rem 0.9rem;
  margin: 0.5rem 0;
  width: 100%;
}

.block {
  margin-bottom 16px


}
.header {
  width 100%
  margin-bottom 24px
  font-size 24px
  color $white_v1
  letter-space 2px
  text-align center
}

.content {
  width 100%
  height: auto
  border-radius 3px

  .block {
    margin-bottom 16px

    .el-input__inner {
      border 1px solid $gray-v6 !important

      .el-icon-user, .el-icon-lock {
        font-size 20px
      }
    }
  }

  .btn-row {
    padding-top 10px;

    .login-btn {
      width 100%
      font-size 16px
      letter-spacing 2px
    }
  }

  .text-line {
    justify-content center
    padding-top 10px;
    font-size 14px;
  }
}

.footer {
  color #ffffff;

  .login-container {
    padding 20px;
  }
}
.login-code {
  width: 50%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding 10px;
  box-sizing: border-box;

  img {
    width: 100%;
    cursor: pointer;
    vertical-align: middle;
  }

}
.login-code-img {
  height: 40px;
  padding-left: 12px;
}
.footer {
  color #ffffff;

  .login-container {
    padding 20px;
  }
}
@keyframes show {

  0%,
  49.99% {
    opacity: 0;
    z-index: 1;
  }

  50%,
  100% {
    opacity: 1;
    z-index: 5;
  }
}
</style>
